import { createStore, applyMiddleware } from 'redux'
import {rootReducer} from './reducers'

import thunk from 'redux-thunk'
import { composeWithDevTools } from 'redux-devtools-extension'

import {getToken} from '@/utils/token'

const middlewares = composeWithDevTools(applyMiddleware(thunk))

const initialState = {
    login: getToken()
}

const store = createStore(rootReducer, initialState ,middlewares)

export default store
